import { getToken1 } from '@/utils/auth'
import request from '@/utils/request'

// export function fetchList(query) {
//   return request({
//     url: '/vue-element-admin/employees',
//     // url: '/vue-element-admin/article/list',
//     method: 'get',
//     params: query
//   })
// }

export function fetchList(query) {
  return request({
    url: '/sap/opu/odata/SAP/ZSY_HR_DZDA_SRV/ZSY_HR_DZDAPZSet?$format=json',
    // url: '/vue-element-admin/article/list',
    method: 'get',
    params: query
  })
}

export function fetchList2(data) {

  return request({
    url: '/sap/opu/odata/SAP/ZSY_HR_DZDA_SRV/ZSY_FIXZ_HSet',
    // url: '/vue-element-admin/article/list',
    headers:{'x-csrf-token': unescape( getToken1('zxsrf_token') ) },
    method: 'post',
    data
  })
}

export function fetchArticle(id) {
  return request({
    url: '/vue-element-admin/article/detail',
    method: 'get',
    params: { id }
  })
}

export function fetchPv(pv) {
  return request({
    url: '/vue-element-admin/article/pv',
    method: 'get',
    params: { pv }
  })
}

export function createArticle(data) {
  return request({
    url: '/vue-element-admin/article/create',
    method: 'post',
    data
  })
}

export function updateArticle(data) {
  return request({
    url: '/vue-element-admin/article/update',
    method: 'post',
    data
  })
}
